Private Declare Function BinSearchPath Lib "kernel32" Alias "SearchPathA" (ByVal lpPath As String, ByVal lpFileName As String, ByVal lpExtension As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long
Private Declare Function GetBinaryType Lib "kernel32" Alias "GetBinaryTypeA" (ByVal lpApplicationName As String, lpBinaryType As Long) As Long
Private Declare Function apiGetVersion Lib "kernel32" Alias "GetVersionExA" (ByRef lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Private Type SHITEMID 'mkid
cb As Long
abID As Byte
End Type
Private Type ITEMIDLIST 'idl
mkid As SHITEMID
End Type
Private Type BROWSEINFO 'bi
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" _
(ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" _
(lpBrowseInfo As BROWSEINFO) As Long
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Const BIF_RETURNONLYFSDIRS = &H1
Private Const SCS_32BIT_BINARY = 0
Private Const SCS_DOS_BINARY = 1
Private Const SCS_WOW_BINARY = 2
Private Const SCS_PIF_BINARY = 3
Private Const SCS_POSIX_BINARY = 4
Private Const SCS_OS216_BINARY = 5
Public Enum CSBinaryTypes
NonExecutable
BinaryWin_32Bit
BinaryDos
BinaryOS2_16Bit
BinaryPIF
BinaryPosix
BinaryWin_16Bit
End Enum
'Default Property Values:
Const m_def_SearchPath = ""
Const m_def_File = ""
Const m_def_FilterIndex = 1
Const m_def_Filters = "All Files (*.*)|*.*"
'Property Variables:
Dim m_SearchPath As String
Dim m_File As String
Dim m_Filters As String
Dim m_FilterIndex As Long
Public Property Get FilterIndex() As Long
Attribute FilterIndex.VB_Description = "Returns or sets a default filter for SelectFile or SelectSave dialog box."
Attribute FilterIndex.VB_HelpID = 2019
On Error Resume Next
FilterIndex = m_FilterIndex
End Property
Public Property Let FilterIndex(ByVal newIndex As Long)
On Error Resume Next
m_FilterIndex = Abs(newIndex)
PropertyChanged "FilterIndex"
End Property
Public Property Get Filters() As String
Attribute Filters.VB_Description = "Returns or sets the filters that are displayed in the Type list box of a SelectFile or SelectSave dialog box."
Attribute Filters.VB_HelpID = 2018
On Error Resume Next
Filters = m_Filters
End Property
Public Property Let Filters(ByVal newFilters As String)